﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Guoc.BigMall.WebService
{
   public interface ITokenService
    {
        /// <summary>
        /// 当前用户key： current-user
        /// </summary>
        string CurrentUserKey { get; }
        /// <summary>
        ///  创建token,exp  过期时间
        /// </summary>
        /// <param name="data"></param>
        /// <param name="timeoutHour"></param>
        /// <returns></returns>
        string CreateToken(Dictionary<string,string> data,int ExpireMinute = 30 );

        /// <summary>
        ///  验证token 是否有效
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        bool Validate(string token);
        /// <summary>
        ///  获取token中的用户数据
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        Dictionary<string, string> GetData(string token);
    }
}
